class ChangeDecimalPrecision < ActiveRecord::Migration
  def self.up
    change_column :tuangou_pros,:tprice,:decimal,:precision=>10,:scale => 2
    change_column :products,:price,:decimal,:precision=>10,:scale => 2
    change_column :order_items,:price,:decimal,:precision=>10,:scale => 2
    change_column :cart_items,:price,:decimal,:precision=>10,:scale => 2
  end

  def self.down
    change_column :tuangou_pros,:tprice,:decimal,:precision=>10,:scale => 0
    change_column :products,:price,:decimal,:precision=>10,:scale => 0
    change_column :order_items,:price,:decimal,:precision=>10,:scale => 0
    change_column :order_items,:price,:decimal,:precision=>10,:scale => 0
  end
end
